// 资讯
import Vue from "vue";
var info = {
  // 活动首页信息接口
  apiSecretaryActivityIndex: function apiSecretaryActivityIndex(ip, postdata) {
    var ipstr = ip + "?activityId=" + postdata.activityId;
    return Vue.http.get(ipstr, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data.message);
      }
    });
  },
  // 分页伍打Call记录接口
  apiSecretaryActivityCallrecordlistpage: function apiSecretaryActivityCallrecordlistpage(
    ip,
    postdata
  ) {
    var ipstr =
      ip +
      "?activityId=" +
      postdata.activityId +
      "&teamId=" +
      postdata.teamId +
      "&pageSize=" +
      postdata.pageSize;
    +"&pageNo=" + postdata.pageNo;
    return Vue.http.get(ipstr, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data.message);
      }
    });
  },
  // 为指定队伍打Call接口
  apiSecretaryActivitySavecallrecord: function apiSecretaryActivitySavecallrecord(
    ip,
    postdata
  ) {
    return Vue.http.post(ip, postdata).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data.message);
      }
    });
  },
  // 佩戴勋章
  apipassportuseruseDecoration: function apipassportuseruseDecoration(
    ip,
    postdata
  ) {
    var ipstr =
      ip +
      "?passportId=" +
      postdata.passportId +
      "&decorationId=" +
      postdata.decorationId;
    return Vue.http.get(ipstr, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data.message);
      }
    });
  },
  // 勋章列表
  apipassportuserAlldecoration: function apipassportuserAlldecoration(
    ip,
    postdata
  ) {
    var ipstr = ip + "?passportId=" + postdata.passportId;
    return Vue.http.get(ipstr, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data.message);
      }
    });
  },
  // 勋章列表
  apipassportuseruserteamcallnum: function apipassportuseruserteamcallnum(
    ip,
    postdata
  ) {
    var ipstr =
      ip + "?teamId=" + postdata.teamId + "&userId=" + postdata.userId;
    return Vue.http.get(ipstr, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body);
      } else {
        return Promise.reject(response.data.message);
      }
    });
  }
};
export default info;
